package com.bdqn.t320.bootsecurity.controller;

import org.springframework.security.core.Authentication;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

public class LogoutSuccessHandlerConfig implements org.springframework.security.web.authentication.logout.LogoutSuccessHandler {
    @Override
    public void onLogoutSuccess(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse, Authentication authentication) throws IOException, ServletException {
        System.out.println("可以在这里进行一些数据的清除操作");
        //httpServletResponse.sendRedirect("/crm/logout");
        httpServletRequest.getRequestDispatcher("logout").forward(httpServletRequest, httpServletResponse);
    }
}
